﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Zerg
{
	public class ActionProduceHydralisk : ActionProduceFromLarva
	{
		public static ActionProduceHydralisk Instance = new ActionProduceHydralisk();
		private ActionProduceHydralisk() : base(33, 100, 50, 2) { }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return state.HydraliskDen.Count > 0;
		}
		public override void OnProductionFinished(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			state.Hydralisk++;
		}
		public override string EventName { get { return "ActionSpawnHydralisk"; } }
		public override bool IsInvalid(Jay.Sc2.Bof.Lib.State.IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return base.IsInvalid(bo) || state.HydraliskDen.Total == 0;
		}
		private IAction[,] m_Requirements;
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionProduceHydraliskDen.Instance } };
				return m_Requirements;
			}
		}
	}
}
